#pragma once
#include <map>
#include <string>
#include <memory>
#include <iostream>
#include "fufu_type.h"
class Var
{
public:
	std::string name;
	std::string label;
	std::shared_ptr<FuFuType> type;
	int var_type = STACK;
	static enum
	{
		GLOBAL,
		STACK,
		REG,
	};
};

class WhenChain
{
public:
	WhenChain() = default;
	std::string currBodyEndLable;
	std::string currStratLable;
	std::shared_ptr<WhenChain> prev;
	std::shared_ptr<WhenChain> next;
};

class GlobalEnv
{
public:
	static	std::map<std::string, std::string> strings_table;
	static  std::shared_ptr<WhenChain> whenChain;
};



class Env
{
public:
	int lable_count = 0;
	std::map<std::string, std::unique_ptr<Var>> local_vars;
	std::vector<std::string> _vars_name;
	std::shared_ptr<Env> prev;
	std::shared_ptr<Env> next;
};


